package itheima.d01;

import java.util.LinkedList;

public class Test {
    public static void main(String[] args) {
        LinkedList<String> list = new LinkedList<>();
        list.addLast("第一号人");
        list.addLast("第二号人");
        list.addLast("第三号人");
        list.addLast("第四号人");
        System.out.println(list);

        System.out.println(list.removeFirst());
        System.out.println(list.removeFirst());
        System.out.println(list.removeFirst());
        System.out.println(list);

        System.out.println("=====================================");


        LinkedList<String> stack = new LinkedList<>();
        //压栈(push)
        stack.push("第一颗子弹");
        stack.push("第二颗子弹");
        stack.push("第三颗子弹");
        stack.push("第四颗子弹");
        System.out.println(stack);
        //出栈(pop)
        System.out.println(stack.pop());
        System.out.println(stack.pop());
        System.out.println(stack);
    }
}
